package core

import java.lang.ref.ReferenceQueue.Null;

class Person {
	String firstName
	String lastName
	Date   birthDate
	String fullName
	 //gender
	 //meritalStattus
	 //
	
	
	List legalIdentifier
	String toString() {
		firstName + ' ' + lastName + ' ' + ' ' + birthDate?.format('YY-MM-DD')
			}
	static hasMany = [legalIdentifiers: LegalIdentifier, nationalities: Nationality, personAddresses: PersonAddress]
	  
	
	   static transients = ['age']
	   int getAge() {
		   (new Date() - birthDate)/365.25
	   }
   static constraints = {
	   fullName nullable: true
	   firstName blank:false
	   lastName blank:false
	   birthDate blank:false
   }
}
	 




